<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page trimDirectiveWhitespaces="true"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%-- <%@taglib uri="http://hitt.com/common/" prefix="common"%> --%>
<%-- <c:if test="${!empty user}">

	<script type="text/javascript">
		location.href = "<c:url value='/Customer/loadlists.action'/>";
	</script>

</c:if> --%>

<!DOCTYPE HTML>
<html>
<head>
<script src="<%=basePath%>js/home.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>汽车维修管理系统-Ssm-amms</title>
<!-- 引入css样式文件 -->
<!-- Bootstrap Core CSS -->
<link href="<%=basePath%>css/bootstrap.min.css" rel="stylesheet" />
<!-- MetisMenu CSS -->
<link href="<%=basePath%>css/metisMenu.min.css" rel="stylesheet" />
<!-- DataTables CSS -->
<link href="<%=basePath%>css/dataTables.bootstrap.css" rel="stylesheet" />
<!-- Custom CSS -->
<link href="<%=basePath%>css/sb-admin-2.css" rel="stylesheet" />
<!-- Custom Fonts -->
<link href="<%=basePath%>css/font-awesome.min.css" rel="stylesheet"
	type="text/css" />

<link href="<%=basePath%>css/boot-crm.css" rel="stylesheet"
	type="text/css" />

</head>
<body>

	<div id="wrapper">
		<!-- 导航栏部分 -->
		<nav class="navbar navbar-default navbar-static-top" role="navigation"
			style="margin-bottom: 0">
			<div class="navbar-header">
				<a class="navbar-brand" href="#">汽车维修管理系统</a>
			</div>
			
			
			
			
			<!-- 左侧显示列表部分 start-->
			<div class="navbar-default sidebar" role="navigation">
				<div class="sidebar-nav navbar-collapse">
					<ul class="nav" id="side-menu">
						<li><a href="#"><i class=""></i>用户：${sessionScope.customer.cname} </a></li>
						
						<li class="divider"></li>
						<li><a href='<c:url value="/Customer/outlogin.action"/>'> <i class=""></i>退出登录</a></li>
					</ul>
				</div>
				
			</div>
			<!-- 左侧显示列表部分 end-->
			
			
			
			
		</nav>
		
		
		<!-- 维修信息展示部分  start-->
		
		<div id="page-wrapper">
			<div class="row">
				<div class="col-lg-12">
					<h1 class="page-header">信息列表</h1>
				</div>
				<!-- /.col-lg-12 -->
			</div>
			<!-- /.row -->
			<div class="panel panel-default">
				<div class="panel-body">

					
				</div>
			</div>
			<c:if test="${empty info}">
				<a href="#" class="btn btn-primary" data-toggle="modal"
				data-target="#newCustomerDialog" onclick="clearInfo()">新建</a>
			</c:if>
			
				
				
				
				<c:if test="${!empty info}">
					<!-- 维修信息列表 -->
			<div class="row">
				<div class="col-lg-12">
					<div class="panel panel-default">
						<div class="panel-heading">信息列表</div>
						<!-- /.panel-heading -->
						<table class="table table-bordered table-striped">
							<thead>
								<tr>
									<th>车主编号</th>
									<th>车主名称</th>
									<th>车辆品牌</th>
									<th>车辆颜色</th>
									<th>车辆大架号</th>
									<th>受损部位</th>
									<th>其他备注</th>
									<th>维修信息创建时间</th>
									<th>状态</th>
									<th>操作</th>
								</tr>
							</thead>
							<tbody>
								
									<tr>
										<td>${info.info_customer_id }</td>
										<td>${info.info_customer_name }</td>
										<td>${info.info_logo }</td>
										<td>${info.info_clour }</td>
										<td>${info.info_customer_carcode }</td>
										<td>${info.info_place }</td>
										<td>${info.info_other }</td>
										<td><fmt:formatDate value="${info.info_createtime}" pattern="yyyy-MM-dd HH:mm:ss" /></td>
										<td>${info.info_state}</td>


										<td><a href="#" class="btn btn-primary btn-xs"
											data-toggle="modal" data-target="#customerEditDialog"
											onclick="showInfo('${info.info_customer_carcode}')">修改</a> 
											<a href="#" class="btn btn-danger btn-xs"
											onclick="deleteInfo('${info.info_customer_carcode}')">删除</a>
										</td>
									</tr>
								
							</tbody>
						</table>
						
					
					</div>
					
				</div>
				
			</div>
			</c:if>
			<c:if test="${empty info}">
				<h1 align="center" style="color:red">您暂时没有维修信息！请新建！</h1>
			</c:if>
		</div>
		
		<!-- 维修信息展示部分  end-->
				
				
				
				
			
			
				
				
		
		
		
		
		
	</div>
	<!-- 创建信息模态框 -->
	<div class="modal fade" id="newCustomerDialog" tabindex="-1"
		role="dialog" aria-labelledby="myModalLabel">
		<div class="modal-dialog" role="document">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-label="Close">
						<span aria-hidden="true">&times;</span>
					</button>
					<h4 class="modal-title" id="myModalLabel">新建维修信息</h4>
				</div>
				<div class="modal-body">
					<form class="form-horizontal" id="new_info_form">
						<input type="hidden" name="info_customer_id"
							value="${sessionScope.customer.cid}" />
						<input type="hidden" name="info_customer_name"
							value="${sessionScope.customer.cname}" />
							<input type="hidden" name="info_customer_carcode"
							value="${sessionScope.customer.carcode}" />
							
						<div class="form-group">
							<label for="new_customerFrom"
								style="float:left;padding:7px 15px 0 27px;">车辆品牌</label>
							<div class="col-sm-10">
								<select class="form-control" id="new_logo"
									name="info_logo">
									<option value="">--请选择--</option>
									<c:forEach items="${logo}" var="logo">
										<option value="${logo.bid}">${logo.bitem}</option>
									</c:forEach>


								</select>
							</div>
						</div>
						<div class="form-group">
							<label for="new_custIndustry"
								style="float:left;padding:7px 15px 0 27px;">车辆颜色</label>
							<div class="col-sm-10">
								<select class="form-control" id="new_clour"
									name="info_clour">
									<option value="">--请选择--</option>
									<c:forEach items="${clour}" var="clour">
										<option value="${clour.bid}">${clour.bitem}</option>
									</c:forEach>


								</select>
							</div>
						</div>
						<div class="form-group">
							<label for="new_custLevel"
								style="float:left;padding:7px 15px 0 27px;">受损部位</label>
							<div class="col-sm-10">
								<select class="form-control" id="new_place"
									name="info_place">
									<option value="">--请选择--</option>
									<c:forEach items="${place}" var="place">
										<option value="${place.bid}">${place.bitem}</option>
									</c:forEach>

								</select>
							</div>
						</div>
					
						<div class="form-group">
							<label for="new_address" class="col-sm-2 control-label">其他备注</label>
							<div class="col-sm-10">
								<input type="text" class="form-control" id="new_other"
									placeholder="其他备注" name="info_other" />
							</div>
						</div>

					</form>
				</div>

				<div class="modal-footer">
					<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
					<button type="button" class="btn btn-primary"
						onclick="addinfo()">提交信息</button>
				</div>
			</div>
		</div>
	</div>
	
	
	<!-- 修改信息模态框 -->
	<div class="modal fade" id="customerEditDialog" tabindex="-1"
		role="dialog" aria-labelledby="myModalLabel">
		<div class="modal-dialog" role="document">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-label="Close">
						<span aria-hidden="true">&times;</span>
					</button>
					<h4 class="modal-title" id="myModalLabel">修改维修信息</h4>
				</div>
				<div class="modal-body">
					<form class="form-horizontal" id="edit_info_form">
						<input type="hidden" id="edit_info_customer_carcode" name="info_customer_carcode" />
						
						
						<div class="form-group">
							<label for="edit_customerFrom"
								style="float:left;padding:7px 15px 0 27px;">车辆品牌</label>
							<div class="col-sm-10">
								<select class="form-control" id="edit_info_logo"
									name="info_logo">

									<option value="">--请选择--</option>
									<c:forEach items="${logo}" var="logo">
										<option value="${logo.bid }">${logo.bitem}</option>

									</c:forEach>


								</select>
							</div>
						</div>
						<div class="form-group">
							<label for="edit_custIndustry"
								style="float:left;padding:7px 15px 0 27px;">车辆颜色</label>
							<div class="col-sm-10">
								<select class="form-control" id="edit_info_clour"
									name="info_clour">
									<option value="">--请选择--</option>
									<c:forEach items="${clour}" var="clour">
										<option value="${clour.bid }">${clour.bitem}</option>

									</c:forEach>

								</select>
							</div>
						</div>
						<div class="form-group">
							<label for="edit_custLevel"
								style="float:left;padding:7px 15px 0 27px;">损坏部位</label>
							<div class="col-sm-10">
								<select class="form-control" id="edit_info_place"
									name="info_place">
									<option value="">--请选择--</option>
									<c:forEach items="${place}" var="place">
										<option value="${place.bid}">${place.bitem}</option>

									</c:forEach>


								</select>
							</div>
						</div>
						<div class="form-group">
							<label for="edit_linkMan" class="col-sm-2 control-label">其他备注</label>
							<div class="col-sm-10">
								<input type="text" class="form-control" id="edit_info_other"
									placeholder="其他备注" name="info_other" />
							</div>
						</div>
						
						
						
						
					</form>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
					<button type="button" class="btn btn-primary"
						onclick="editInfo()">保存修改</button>
				</div>
			</div>
		</div>
	</div>
	<!-- 引入js文件 -->
	<!-- jQuery -->
	<script src="<%=basePath%>js/jquery-1.11.3.min.js"></script>
	<!-- Bootstrap Core JavaScript -->
	<script src="<%=basePath%>js/bootstrap.min.js"></script>
	<!-- Metis Menu Plugin JavaScript -->
	<script src="<%=basePath%>js/metisMenu.min.js"></script>
	<!-- DataTables JavaScript -->
	<script src="<%=basePath%>js/jquery.dataTables.min.js"></script>
	<script src="<%=basePath%>js/dataTables.bootstrap.min.js"></script>
	<!-- Custom Theme JavaScript -->
	<script src="<%=basePath%>js/sb-admin-2.js"></script>
	<!-- 编写js代码 -->


	<!--关闭请理文本框内容  -->

</body>
</html>
